Skip to content

Add migration helper for Tabnine CLI to opencode - #1

Open
Pavel-tabnine wants to merge 2 commits into
mainfrom
feat/migration-helper
Open

Add migration helper for Tabnine CLI to opencode#1
Pavel-tabnine wants to merge 2 commits into
mainfrom
feat/migration-helper

Conversation

@Pavel-tabnine

@Pavel-tabnine Pavel-tabnine commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds a migration_helper/ subtree that helps users move their Tabnine CLI (or Gemini CLI) configuration into opencode.

It contains two opencode skills that run as interactive wizards inside opencode itself, plus slash commands and a small bash installer:

  • migrate-from-tabnine-cli (/migrate) — migrates MCP servers, skills, subagents, slash commands, and the contents of Tabnine CLI extensions. Run once per target scope (global or project).
  • migrate-tabnine-context (/migrate-context) — migrates context/memory files (TABNINE.md, GEMINI.md, or custom context.fileName files) into opencode's AGENTS.md. Re-runnable per repository.

What's inside migration_helper/

migration_helper/
├── LICENSE                       # MIT, subtree-scoped
├── README.md                     # install (script or manual) + usage
├── install.sh                    # bash installer (executable)
├── commands/
│   ├── migrate.md                # /migrate slash command
│   └── migrate-context.md        # /migrate-context slash command
└── skills/
    ├── migrate-from-tabnine-cli/
    │   ├── SKILL.md              # main wizard skill
    │   └── references/
    │       ├── source-map.md     # where Tabnine CLI stores each thing
    │       └── mapping.md        # field-by-field translation rules
    └── migrate-tabnine-context/
        └── SKILL.md              # context-file wizard skill

What it migrates

MCP servers (including field renames opencode requires, e.g. envenvironment, and $VAR{env:VAR} value rewrites), skills, subagents, slash commands, extension contents, and context files. Fields with no opencode equivalent are dropped with a note in the wizard's summary. Nothing is deleted from the Tabnine CLI installation — both wizards are copy-and-translate flows, and neither overwrites an existing opencode file without asking.

Out of scope: OAuth tokens (users re-authenticate remote MCP servers on first use), Tabnine credentials, admin policy fields, hooks, themes, keybindings, and general settings.

Installer behaviour

./install.sh                 # global: ~/.config/opencode/
./install.sh --project       # project: ./.opencode/
./install.sh --overwrite     # overwrite existing files without prompting

For every file it wants to place:

  • Missing target → copy.
  • Identical target → skip (idempotent).
  • Different target → show a unified diff, prompt [s]kip / [o]verwrite / [r]ename (rename appends .bak-YYYYMMDD-HHMMSS).
  • No terminal to prompt on (e.g. piped/CI runs) → keep the existing file and say so, never overwrite.

Manual cp commands are documented as a fully supported alternative (recommended path on Windows).

Verification

  • bash -n install.sh passes; installer tested on macOS (system bash 3.2) and Debian: fresh install (6 files), idempotent re-run, --project, --overwrite, interactive skip/overwrite/rename, and non-interactive runs.
  • Both wizards exercised end-to-end inside opencode against sandboxed fixture homes covering: remote/local MCP servers (field renames, enablement, disabled + stale entries), skills (including name normalization and Gemini-specific-body flagging), agents (field translation, remote A2A skip), commands (all placeholder rewrites, nested namespacing), extension unpacking, Gemini-mode layout (~/.gemini), and context-file migration (fresh target, merge into existing AGENTS.md, repeat runs).
  • Migrated configs verified to boot opencode cleanly with the items registered; source trees verified byte-identical after every run.
  • Reference docs (source-map.md, mapping.md) verified against the Tabnine CLI and opencode sources.

Root README

One new section, ## Migrate from Tabnine CLI, links to migration_helper/README.md. Otherwise the root README is unchanged.

Licensing

migration_helper/LICENSE scopes this subtree to MIT with Copyright (c) 2026 Tabnine Ltd.. This is a documentation + shell subtree; MIT is the shortest, most permissive, best-known license for that shape. The root repo's proprietary posture (© Tabnine. All rights reserved.) is unchanged — only this subtree is MIT.

Adds migration_helper/ subtree with:

- skills/migrate-from-tabnine-cli/ — interactive wizard skill that
  discovers Tabnine CLI (or Gemini CLI) configuration on disk, asks
  the user per category what to migrate, and translates fields into
  opencode's schema. Includes reference docs for source paths and
  field-by-field translation rules.
- commands/migrate.md — /migrate slash command as an entry point to
  the wizard.
- install.sh — bash installer that copies the skill and command into
  either ~/.config/opencode/ (default) or ./.opencode/ (--project).
  Shows a diff and prompts skip/overwrite/rename on collisions.
  Supports --overwrite to bypass prompts.
- README.md — install (script or manual copy) and usage docs.
- LICENSE — MIT, subtree-scoped.

Root README gets one new section linking to migration_helper/README.md.
@Pavel-tabnine
Pavel-tabnine force-pushed the feat/migration-helper branch 2 times, most recently from f8d7d34 to f59fccc Compare August 2, 2026 11:44
Review-driven fixes to migrate-from-tabnine-cli, verified against
opencode 1.18.9 and tabnine-cli sources and via end-to-end wizard runs:

- MCP: env -> environment (opencode's key; env was silently ignored),
  keep cwd and per-server timeout (both supported), rewrite $VAR/${VAR}
  values to {env:VAR} unconditionally, back up opencode.json before merge
- Commands: single folder-mirroring namespacing policy, inline all three
  placeholder rewrites ({{args}}, !{...}, @{...}), no-placeholder rule
- Skills: defined gemini-ism body scan, defensive name normalization,
  duplicate-name semantics corrected (log-only warning, coin-flip winner)
- Discovery: A2A array-frontmatter bundles skipped up front, built-ins
  shown as "(built-in, skipped)", stale enablement entries ignored,
  extension-enablement respected
- source-map: settings precedence corrected (system tier wins last)
- Wizard UX: inline subagent/primary explanation, defined per-category
  scope override, no migrate-all shortcut

New: migrate-tabnine-context skill + /migrate-context command that
copies TABNINE.md/GEMINI.md context files into AGENTS.md, re-runnable
per repository, merge-or-skip on existing targets.

Installer: installs both skills, survives non-interactive runs
(default-skip when /dev/tty cannot be opened), accurate --overwrite help.
@Pavel-tabnine
Pavel-tabnine force-pushed the feat/migration-helper branch from f59fccc to b6f9b13 Compare August 3, 2026 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant